<?php
namespace app\admin\controller\test;
use \app\admin\controller\Base;
class Upload extends Base{
    

    public function index(){
        $this->assign(get_defined_vars());
        
        return $this->fetch();
    }    
    
    public function web(){
        $WebUploader =  new \logic\sys\WebUploader();
        $WebUploader->merge($key);
        
        
        
        
        $this->assign(get_defined_vars());        
        return $this->fetch();
    }
    
    public function upfile(){
        try{
            $WebUploader =  new \logic\sys\WebUploader();
            $ret = $WebUploader->uploadFile();
            $data = json_encode(['code'=> 1, 'msg'=>'上传成功','data'=> $ret ] );
        }catch( \think\Exception $e){
            $data = json_encode(['code'=> 0, 'msg'=>$e->getMessage()]);
        }
        exit( $data);
    }
    
    
    public function test(){
        $data = [
            'aaa' => 10,
            'bbb' => 9,
            'ccc' => 101
        
        ];
        
        $check = [
            'aaa'   => ['reg'=> 'gt:1'],
            'bbb'   => ['reg'=> 'bt:[1,10)'],
            'ccc'   => ['reg'=> 'bt:[1,1000]']
        ];
        
        $save =  pVerify($check,$data);
        dump($save);
        
    }
}